<template>
	<view style="margin-top: 20rpx;margin-bottom: 20rpx;display: flex;justify-content: flex-end;">
		<button class="cu-btn bg-blue shadow-blur radius" @tap="AddInfo({XX_ID:0,STATE:'1'})">新增简介</button>
	</view>
	<view class="body">
		<scroll-view scroll-x="true">
			<view class="table-lists">
				<view class="table-title">
					<view class="">信息类型</view>
					<view class="">信息标题</view>
					<view class="">状态</view>
				</view>

				<view class="table-item">
					<view v-for="item in DAT" :key="item.XX_ID" @tap="handleto(item)">
						<view class="">{{item.XX_TYPE}}</view>
						<view class="" style="text-decoration: underline;color: blue;">{{item.XX_BT}}</view>
						<view class="">{{item.STATENR}}</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<view v-if="!DAT.length" class="text-sm text-center">-- 暂无数据 --</view>
	</view>
</template>

<script lang="ts" setup>
	import {onMounted,reactive,ref} from "vue"
	import {onLoad,onShow} from "@dcloudio/uni-app";
	import {usegetSchoolInfo} from "./useshool"
	const {initgetSchoolInfo,DAT,COUNT}  = usegetSchoolInfo()
	function handleto(data:any){
		uni.navigateTo({
			url: `/pages/Infomange/InfomangeTap/schoolEdit?DATA=` + encodeURIComponent(JSON.stringify(data))
		})
	}
	function AddInfo(data:any){
		uni.navigateTo({
				url: `/pages/Infomange/InfomangeTap/schoolEdit?DATA=` + encodeURIComponent(JSON.stringify(data))
			})
	}
	onShow(() => {
		initgetSchoolInfo()
	})
</script>

<style lang="scss">
	.body {
		width: 100%;
		height: 100%;
		background-color: white;
	}

	.formdata {
		.formdata-item {
			padding: 0 32rpx 0 32rpx;
			border-bottom: 4rpx #F7F8FC solid;
			width: 100%;
			height: 110rpx;
			display: flex;
			align-items: center;

			.text {
				margin-right: 32rpx;
			}
		}
	}

	.flex {
		padding: 0 32rpx 0 32rpx;
		width: 750rpx;
		height: 110rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.table-title-bg {
		background-color: #dddd;
	}

	.state {
		text {
			background-color: #dbdcdf;
			color: white;
			padding: 5rpx;
			font-size: 20rpx
		}
	}

	.table {}

	.table-lists {
		display: flex;
		flex-direction: column;
		width: 750rpx;
		font-size: 24rpx;

		.table-title {
			width: 100%;
			display: flex;
			height: 120rpx;
			font-weight: 600;
			background-color: #DDDDDD;
			color: #585850;

			view {
				padding: 10rpx;
				flex: 1;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}

		.table-item {
			width: 100%;
			display: flex;
			flex-direction: column;

			view {
				width: 100%;
				display: flex;
				height: 100rpx;

				view {
					color: #666666;
					flex: 1;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
</style>
